home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / yvals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  5.6 KB  |  240 lines  |  [TEXT/MMCC]

  1. /* yvals.h values header */
  2. #ifndef _YVALS
  3. #define _YVALS
  4.  
  5. #if __MWERKS__
  6. #pragma options align=mac68k
  7. #endif
  8.  
  9.         /* determine target */
  10. #if defined(__TINY__)||defined(__SMALL__)||defined(__COMPACT__)||\
  11.     defined(__MEDIUM__)||defined(__LARGE__)||defined(__HUGE__)
  12.  #define _INTELx86 1
  13.  #define _MSDOS_C_LIB 1
  14.  #if defined(_MSC)
  15.  #elif __TURBOC__ == 0x0452
  16.   #define _BORLAND40 1
  17.  #else
  18.   #define _BORLAND31 1
  19.  #endif
  20.  
  21. #elif defined(sun)
  22.  #define _INTELx86 0
  23.  #define _POSIX_C_LIB 1
  24.  
  25. #elif defined(__MWERKS__)
  26.  #define _INTELx86 0
  27.  #define _POSIX_C_LIB 0
  28.  #define _C_LIB_IS_EXTERN_C 1
  29.  #define _SIGNED_CHAR_IS_DISTINCT 1
  30.  
  31. #else
  32.  #define _INTELx86 0
  33.  #define _POSIX_C_LIB 1
  34.  #define _PHI_ANALYZER 1
  35. #endif
  36.         /* errno properties */
  37. #define _EDOM    33
  38. #define _ERANGE    34
  39. #define _EFPOS    35
  40. #define _EILSEQ    36
  41. #define _ERRMAX    37
  42.         /* float properties */
  43. #define _DBIAS    0x3fe
  44. #define _DOFF    4
  45. #define _FBIAS    0x7e
  46. #define _FOFF    7
  47. #define _FRND    1
  48. #if _INTELx86    /* little-endian, big long doubles */
  49.  #define _D0    3
  50.  #define _DLONG    1
  51.  #define _LBIAS    0x3ffe
  52.  #define _LOFF    15
  53. #elif SPARCompiler    /* big-endian, funny long doubles */
  54.  #define _LONG_DOUBLE_HAS_HIDDEN_BIT 1
  55.  #define _D0    0
  56.  #define _DLONG    1
  57.  #define _LBIAS    0x3ffe
  58.  #define _LOFF    15
  59. #else    /* big-endian, small long doubles */
  60.  #define _LONG_DOUBLE_HAS_HIDDEN_BIT 1
  61.  #define _D0    0
  62.  #define _DLONG    0
  63.  #define _LBIAS    0x3fe
  64.  #define _LOFF    4
  65. #endif
  66.         /* integer properties */
  67. #define _BITS_BYTE    8
  68. #define _C2            1
  69. #define _CSIGN        1
  70. #define _MBMAX        8
  71. typedef int _Wintt;
  72. #define _WCMIN        0
  73. #define _WCMAX        0xffff
  74. #if _INTELx86    /* 16-bit int */
  75.  #define _ILONG    0
  76. #elif __MWERKS__
  77.  #define _ILONG __fourbyteints__
  78. #else    /* 32-bit int */
  79.  #define _ILONG    1
  80. #endif
  81. #define _MAX_EXP_DIG    8    /* for parsing numerics */
  82. #define _MAX_INT_DIG    32
  83. #define _MAX_LOC_STR    16
  84. #define _MAX_SIG_DIG    36
  85. #if defined(_BORLAND40)
  86.  #define _WCHART  /* wchar_t already built-in */
  87.  typedef wchar_t _Wchart;
  88. #elif __MWERKS__
  89.  typedef char _Wchart;
  90. #else
  91.  typedef unsigned short   _Wchart;
  92. #endif
  93.         /* pointer properties */
  94. #if defined(_BORLAND31) || defined(_BORLAND40)
  95.  #include <_null.h>  /* rules are too complicated to recite here */
  96. #endif
  97.  
  98. #if defined(__HUGE__)||defined(__COMPACT__)||defined(__LARGE__)
  99.  #define _NULL    0L
  100.  #if defined(_BORLAND31) || defined(_BORLAND40)
  101.   typedef long _Ptrdifft;
  102.  #else
  103.   typedef int _Ptrdifft;
  104.  #endif
  105.  typedef unsigned int _Sizet;
  106. #elif __MWERKS__
  107.  #define _NULL 0L
  108.  typedef long _Ptrdifft;
  109.  typedef unsigned long _Sizet;
  110. #else
  111.  #define _NULL    0
  112.  typedef int _Ptrdifft;
  113.  typedef unsigned int _Sizet;
  114. #endif
  115.         /* setjmp properties */
  116. #if _INTELx86
  117.  #define _NSETJMP    10
  118. #else
  119.  #define _NSETJMP    80
  120. #endif
  121. #if _HAS_NO_SETJMP    /* should rarely be true */
  122.  #if _USE_EXISTING_SYSTEM_NAMES
  123.   #define _Setjmp setjmp
  124.  #endif
  125.  _EXTERN_C
  126.  int _Setjmp(int *);
  127.  _END_EXTERN_C
  128. #endif /*0*/
  129.         /* signal properties */
  130. #if _INTELx86
  131.  #define _SIGABRT    22
  132. #else
  133.  #define _SIGABRT    6
  134. #endif
  135. #define _SIGMAX        32
  136.         /* stdarg properties */
  137. #if SPARCompiler
  138.  typedef char *_Va_list;
  139.  #ifdef __cplusplus
  140.   extern "C" char __builtin_va_alist;
  141.   extern "C" void *__builtin_va_arg_incr(...);
  142.  #else /* !__cplusplus */
  143.   extern char __builtin_va_alist;
  144.   extern void *__builtin_va_arg_incr();
  145.  #endif  /* __cplusplus */
  146.  #define _Va_start(ap, A) (void)(ap = (char *)&__builtin_va_alist)
  147.  #define _Va_arg(ap, T) ((T *)__builtin_va_arg_incr((T *)ap))[0]
  148. #elif __MWERKS__
  149.  typedef char *_Va_list;
  150.  #define _Va_start_addr(A)        (va_list)(&A+1)
  151.  #define _Va_start(ap,A)        (ap=_Va_start_addr(A))
  152.  #define _Va_arg(ap,T)            (*(*(T **)&ap)++)
  153. #else
  154.  typedef char *_Va_list;
  155.  #define _Bnd(X, bnd)    (sizeof (X) + (bnd) & ~(bnd))
  156.  #define _Va_arg(ap, T)    \
  157.     (*(T *)(((ap) += _Bnd(T, _AUPBND)) - _Bnd(T, _ADNBND)))
  158.  #define _Va_start(ap, A)    \
  159.     (void)((ap) = (char *)&(A) + _Bnd(A, _AUPBND))
  160. #endif
  161.         /* stdlib properties */
  162. #define _EXFAIL    1
  163. typedef struct _Mbstatet {
  164.     _Wchart _Wchar;
  165.     char _State;
  166.     } _Mbstatet;
  167.         /* stdio properties */
  168. #define _FNAMAX    64
  169. #define _FOPMAX    16
  170. #define _TNAMAX    16
  171. typedef struct _Fpost {
  172.     unsigned long _Off;    /* can be system dependent */
  173.     _Mbstatet _Wstate;
  174.     } _Fpost;
  175.         /* storage alignment properties */
  176. #if defined(sun) || defined(_PHI_ANALYZER)
  177.  #define _AUPBND    4U /* sixteen-byte boundaries (2^^4) */
  178.  #define _ADNBND    4U
  179.  #define _MEMBND    4U
  180. #else
  181.  #define _AUPBND    1U /* even-byte boundaries (2^^1) */
  182.  #define _ADNBND    1U
  183.  #define _MEMBND    1U
  184. #endif
  185.  
  186.         /* time properties */
  187. #if __MWERKS__
  188.  #define _CPS    60
  189.  #define _TBIAS    ((4 * 365LU + 1) * 86400)
  190. #else
  191.  #define _CPS    1
  192.  #define _TBIAS    ((70 * 365LU + 17) * 86400)
  193. #endif
  194.         /* naming properties */
  195. #define _USE_EXISTING_SYSTEM_NAMES 1 /* _Open => open etc. */
  196. #ifdef __cplusplus
  197.  #define _EXTERN_C extern "C" {
  198.  #define _END_EXTERN_C }
  199. #else
  200.  #define _EXTERN_C
  201.  #define _END_EXTERN_C
  202. #endif /* __cplusplus */
  203. #if defined(__cplusplus) && defined(_C_LIB_IS_EXTERN_C)
  204.  #define _C_LIB_DECL extern "C" {
  205.  #define _END_C_LIB_DECL }
  206. #else
  207.  #define _C_LIB_DECL
  208.  #define _END_C_LIB_DECL
  209. #endif /* __cplusplus && _C_LIB_IS_EXTERN_C */
  210.         /* handle botched widechar constants as need be */
  211. #if defined(sun)||defined(__CENTERLINE__)||defined(_BORLAND31) \
  212.     || defined(__MWERKS__)
  213.  #define _L(c) (c)
  214. #else
  215.  #define _L(c) L##c
  216. #endif
  217.         /* handle botched auto aggregate inits as need be */
  218. #if defined(__CENTERLINE__)
  219.  #define _Mbstinit(x) \
  220.     static mbstate_t _Mbst0; mbstate_t x; x = _Mbst0
  221. #else
  222.  #define _Mbstinit(x)  mbstate_t x = {0}
  223. #endif
  224.         /* handle botched signed char type as need be */
  225. #if defined(_PH_ANALYZER)||defined(_BORLAND40)
  226.  #define _SIGNED_CHAR_IS_DISTINCT 1
  227. #endif
  228.  
  229. #if __MWERKS__
  230. #pragma options align=reset
  231. #endif
  232.  
  233. #endif /* _YVALS */
  234.  
  235. /*
  236.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  237.  * Consult your license regarding permissions and restrictions.
  238.  */
  239.  
  240.